package com.huatai.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huatai.user.entity.LinkInfo;
import com.huatai.user.entity.ServerInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ServerInfoMapper extends BaseMapper<ServerInfo> {
	@Select("select * from sys_server_info")
	List<ServerInfo> getALLInfo();

	@Select("SELECT max_link FROM sys_server_info WHERE server_ip = #{serverIp}")
	Integer getMaxLinkValue(@Param(value = "serverIp") String serverIp);

	@Select("SELECT count(1) from project_management where server_id = #{serverId} and `enable` = 1")
	Integer getServerInfoByServerID(@Param(value = "serverId") Long serverId);
}
